package lms.service.impl;

import lms.dao.ManagerDao;
import lms.dao.impl.ManagerDaoImpl;
import lms.entity.Admin;
import lms.service.MangerService;

/**
 * @description:
 * @author: Grape_Pip
 */
public class ManagerServiceImpl implements MangerService {

    private ManagerDao managerDao = new ManagerDaoImpl();

    @Override
    public boolean managerLogin(Admin adminUser) {
        if (adminUser == null) {
            return false;
        }
        Admin login = managerDao.mLogin(adminUser);
        if (login != null) {
            return true;
        } else {
            return false;
        }
    }

    @Override
    public boolean managerRegister(String mrName, String mrPassword) {
        if (mrName == null || mrPassword == null) {
            return false;
        }
        int res = managerDao.mRegister(mrName, mrPassword);
        if (res == 1) {
            return true;
        } else {
            return false;
        }
    }
}
